import random
target_num = random.randint(1, 100)
guess_count = 0

while True:
    guess = int(input("请输入你的猜测数字："))
    guess_count += 1

    if guess == target_num:
        print("恭喜你猜对了！",target_num,"你共猜了",guess_count , "次")
        break
    elif guess < target_num:
        print("猜小了，请继续猜测。")
    else:
        print("猜大了，请继续猜测。")